let a = 1;

export function fn() {
  let b = 2;
  return function () {
    console.log(a);
    console.log(b);
  };
}

let niming = fn();
// niming["[[Scopes]]"]
// niming["[[Scopes]]"][0] Closure (fn) {b: 2}
// niming["[[Scopes]]"][1] Module {a: 1, fn: ƒ}
console.log(niming);